<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>

<!-- Authors: Mareike, David -->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="style.css" rel="stylesheet" type="text/css" />

<title>Welcome to the Moss Street Market Admin Page</title>
</head>
<c:if test="${staffmember == null}">
	<jsp:forward page="Login.jsp" />
</c:if>

<c:choose>
	<c:when test="${empty cookie}">
		<jsp:forward page="Login.jsp" />
	</c:when>
	<c:otherwise>
		<!--  if the mossStreetMarketCookie has been set but the username is not in the session object -->
		<c:forEach var="cookieVal" items="${cookie}">
			<c:if test="${cookieVal.key == 'mossStreetMarketCookie'}">
				<c:if test="${empty sessionScope.username}">
					<jsp:forward page="Login.jsp" />
				</c:if>
			</c:if>
		</c:forEach>
	</c:otherwise>
</c:choose>

<body>

	<div class="main">
		<div class="header">
			<div class="header_resize">
				<div class="logo">
					<h1>
						<span>MossStreet</span>Market <small>Organic food,
							pottery, clothing ... just for you</small>
					</h1>
				</div>
				<div class="clr"></div>
				<div class="menu_nav">
					<ul>
						<li class="active"><a href="Admin.jsp">Admin</a></li>
						<li><a href="AddStall.jsp">Add/Modify Stall</a></li>
						<li><a href="AdminAddUser.jsp">Add/Modify User</a></li>
						<li><a href="AdminAddBooking.jsp">Add/Delete Booking</a></li>
					</ul>
				</div>
				<div class="clr"></div>
			</div>
		</div>
		<div class="content">
			<div class="content_resize">
				<div class="mainbar_long">
					<div class="article">
						<h2>
							<span>Welcome to Moss Street Market Admin Page, <c:out
									value="${username}" /> !
							</span>
						</h2>
						<div class="clr"></div>

						<b>Select Action</b> <br> <br> <i>Hint: You can view
							all Stalls, Users, Bookings, etc. by selecting a relevant "Add"
							action and then returning to this screen without completing the
							action.</i> <br> <br>
						<table width="50%">
							<thead>
								<tr>
									<td>
										<form method="post" action="AddStall.jsp">
											<input type="submit" name="addstall" value="Add/Modify Stall">
										</form>
									</td>
									<td>
										<form method="post" action="AdminAddUser.jsp">
											<input type="submit" name="adduser" value="Add/Modify User">
										</form>
									</td>
									<td>
										<form method="post" action="AdminAddBooking.jsp">
											<input type="submit" name="addbooking"
												value="Add/Delete Booking">
										</form>
									</td>

								</tr>
							</thead>
						</table>
						<br> <br>
						<hr>
						<form method="post" action="LoggedOut.jsp">
							Logout of Moss Street Market.<br> <br> <input
								type="submit" name="Log Out" value="Log Out"><br> <br>
						</form>

					</div>
				</div>

				<div class="clr"></div>
			</div>
		</div>

		<div class="footer">
			<div class="footer_resize">
				<p class="lf">
					Copyright &copy; 2011 <a href="#">moSSSolutions</a> - All Rights
					Reserved
				</p>
				<p class="rf">
					Your web-based application provided by <a
						href="http://www.mosssolutions.wordpress.com">moSSSolutions</a>
				</p>
				<div class="clr"></div>
			</div>
		</div>
	</div>
</body>
</html>